const data = {}
let name = 'zhangsan'
Object.defineProperty(data, 'name', {
  get: function() {
    console.log('get')
    return name
  },
  set: function(newValue) {
    console.log('set')
    name = newValue
  }
})
console.log(data.name)
data.name = 'ls'
console.log(data.name)